<?php
namespace Admin\Model;
use Think\Model\RelationModel;
class OrderModel extends RelationModel {
    protected $_link = array(
        'goods'  =>  array(
            'mapping_type'          => self::BELONGS_TO,//必填项 确定表之间的关系
            'class_name'            => 'goods',//必填项 要关联的表名(副表)
            'foreign_key'           => 'goods_id',//必填项 指中间表中主表的外键字段

        ),
        'spec_price'  =>  array(
            'mapping_type'          => self::BELONGS_TO,//必填项 确定表之间的关系
            'class_name'            => 'spec_price',//必填项 要关联的表名(副表)
            'foreign_key'           => 'spec_rules_id',//必填项 指中间表中主表的外键字段

        ),
    );
}